/**
 * 检查ID为1的物品
 */

const mysql = require('mysql2/promise');

const DB_CONFIG = {
    host: '43.143.253.188',
    port: 3306,
    user: 'nextjs',
    password: 'yEAiRE2jcxTyRBy5',
    database: 'nextjs',
    charset: 'utf8mb4'
};

async function checkId1() {
    const connection = await mysql.createConnection(DB_CONFIG);

    try {
        // 检查ID为1的物品
        const [rows] = await connection.execute(
            'SELECT id, name FROM basic_items WHERE id = 1'
        );

        if (rows.length > 0) {
            console.log('ID为1的物品:', rows[0]);
        } else {
            console.log('ID为1的位置是空的');
        }

        // 检查前10个ID
        const [first10] = await connection.execute(
            'SELECT id, name FROM basic_items WHERE id <= 10 ORDER BY id'
        );

        console.log('\n前10个ID的物品:');
        first10.forEach(item => {
            console.log(`ID ${item.id}: ${item.name}`);
        });

    } finally {
        await connection.end();
    }
}

checkId1().catch(console.error);
